package com.neo.debade.base.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

//@Controller
public class BaseController {

	protected Log logger = LogFactory.getLog(getClass());

	/**
	 * @param requset
	 * @param response
	 * @param data
	 */
	public void print(HttpServletRequest request,
			HttpServletResponse response, String data) {
		response.setContentType("text/html; charset=UTF-8");
		PrintWriter out = null;
		try {
			out = response.getWriter();
			out.print(data);
		} catch (IOException e) {
			e.printStackTrace();
			// out.print("{'state':'error','message':" + e.getMessage() + "}");
		} finally {
			if (out != null) {
				out.flush();
				out.close();
			}
		}
	}
}
